EMT Practice Test

1. Question Content...


Question List

Question1: What is true about Python packages? (Select two answers)

Question2: Assuming that the code below has been executed successfully, which of the following expressions evaluate to True? (Select two answers)

Question3: Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers)

Question4: What is the expected output of the following snippet?

Question5: What is the expected behavior of the following code?

Question6: Assuming that the code below has been placed inside a file named code.py and executed successfully, which of the following expressions evaluate to True? (Select two answers)

Question7: Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers.)

Question8: What is the expected output of the following code?

Question9: Which of the following expressions evaluate to True? (Select two answers)

Question10: Assuming that the code below has been executed successfully, which of the following expressions evaluate to True? (Select two answers)

Question11: What is a true about python class constructors? (Select two answers)

Question12: Which of the following lines of code will work flawlessly when put independently inside the add_new () method in order to make the snippet's output equal to [0, 1, 21 ? (Select two answers)

Question13: Which of the following statements are true? (Select two answers)

Question14: What is the expected behavior of the following code?

Question15: What is the expected behavior of the following code?

Question16: What is the expected output of the following snippet?

Question17: A Python module named pymod.py contains a variable named pyvar.
Which of the following snippets will let you access the variable? (Select two answers)

Question18: Assuming that the following snippet has been successfully executed, which of the equations are False? (Select two answers)

Question19: What is the expected output of the following code?

Question20: Assuming that the following snippet has been successfully executed, which of the equations are True? (Select two answers)

Question21: Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Select two answers)

Question22: What is true about Python class constructors? (Choose two.)

Question23: Assuming that the following code has been executed successfully, selected the expression which evaluate to True (Select two answers)

Question24: Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers)

Question25: Which of the equations are True? (Select two answers)

Question26: There is a stream named s open for writing. What option will you select to write a line to the stream''

Question27: Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Select two answers) string = 'python' [::2] string = string[-1] + string[-2]

Question28: What is the expected output of the following code?

Question29: What is the expected out of the following code of the file named zero_length_existing_file is a zero-length file located inside the working directory?

Question30: What is the expected behavior of the following code?

Question31: What is the expected behavior of the following code?

Question32: What is true about Python packages? (Select two answers)

Question33: A two-parameter lambda function raising its first parameter to the power of the second parameter should be declared as:

Question34: What is true about Python class constructors? (Select two answers)

Question35: The following expression
1+-2
is:

Question36: What is the expected output of the following code?

Question37: A property that stores information about a given class's super-classes is named:

Question38: What is the expected behavior of the following snippet?

It will:

Question39: What is true about Python class constructors? (Choose two.)

Question40: Which of the following expression evaluate to True? (Select two answers)

Question41: What is true about Object-Oriented Programming in Python? (Select two answers)

Question42: If you want to access an exception object's components and store them in an object called e, you have to use the following form of exception statement

Question43: What is the expected output of the following code?

Question44: What is the expected behavior of the following code?

Question45: Python's built-in function named open () tries to open a file and returns:

Question46: What is the expected behavior of the following snippet?

It will:

Question47: Which of the equations are True? (Select two answers)

Question48: The__bases__property contains:

Question49: What is the expected output of the following code if there is no file named non existing_file inside the working directory?

Question50: Assuming that the V variable holds an integer value to 2, which of the following operators should be used instead of OPER to make the expression equal to 1?
V OPER 1 -

Question51: What is the expected behavior of the following code?

Question52: Which of the following statement are true? (Select two answers)

Question53: Which of the following lines of code will work flawlessly when put independently inside the add_new () method in order to make the snippet's output equal to [0, 1, 21 ? (Select two answers)

Question54: There is a stream named s open for writing. What option will vou select to write a line to the stream''

Question55: A Python module named pymod, py contains a function named pyfun ( ).
Which of the following snippets will let you invoke the function? (Select two answers)

Question56: What is the expected output of the following snippet?

Question57: What is the expected behavior of the following code?

Question58: Which one of the platform module functions should be used to determine the underlying platform name?

Question59: Is it possible to safely check if a class object has a certain attribute0

Question60: What is true about Object-Oriented Programming in Python? (Select two answers)

Question61: Assuming that the code below has been placed inside a file named code.py and executed successfully which of the following expressions evaluate to True? (Select two answers)

Question62: The following class definition is given. We want the show () method to invoke the get () method, and then output the value the get () method returns. Which of the invocations should be used instead of XXX?

Question63: Python's built-in function named open () tries to open a file and returns:

Question64: What is the expected behavior of the following code?

Question65: What is the output of the following piece of code?

Question66: Assuming that the code below has been placed inside a file named code.py and executed successfully, which of the following expressions evaluate to True? (Select two answers)

Question67: If you need a function that does nothing, what would you use instead of XXX? (Select two answers) def idler ( ):
XXX

Question68: A variable stored separately in every object is called:

Question69: Which of the following sentences are true? (Select two answers)

Question70: What is the expected output of the following code?

Question71: You need data which can act as a simple telephone directory. You can obtain it with the following clauses (choose two relevant variants; assume that no other items have been created before)

Question72: Assuming that the following snippet has been successfully executed, which of the equations are False? (Select two answers)

Question73: The first parameter of each method:

Question74: What is the expected output of the following code?

Question75: What can you deduce from the following statement0 (Select two answers) str = open('file.txt', "rt")

Question76: Select the valid fun () invocations:
(select two answers)
def fun (a, b=0):
return a*b

Question77: What is the expected behavior of the following code?

Question78: Which line can be used instead of the comment to cause the snippet to produce the following expected output? (Select two answers) Expected output:
1 2 3
Code:

Question79: Files with the suffix .pyc contain:

Question80: Which of the following lambda function definitions are correct? (Select two answers)

Question81: What is the expected behavior of the following code?

Question82: Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Select two answers)

Question83: What is the expected output of the following code?

Question84: With regards to the directory structure below, select the proper forms of the directives in order to import module_ a. (Select two answers)

Question85: A compiler is a program designed to (select two answers)

Question86: What is the expected behavior of the following code?

Question87: The following class hierarchy is given. What is the expected output of the code?

Question88: Which of the following lines of code will work flawlessly when put independently inside the add_new () method in order to make the snippet's output equal to [0, 1, 21 ? (Select two answers)

Question89: Which of the following statements are true? (Select two answers)

Question90: What can you do if you don't like a long package path tike this one0 import alpha.beta.gamma.delta.epsiIon.zeta

Question91: What is the expected output of the following code if there is no file named non existing_file inside the working directory?